import org.jcsp.lang.CSProcess;
import org.jcsp.lang.ChannelInputInt;
import org.jcsp.lang.ChannelOutputInt;
import org.jcsp.lang.Parallel;
import org.jcsp.plugNplay.ints.PrefixInt;


public	class Phil implements CSProcess { 
		int number;
		private ChannelInputInt in1  = null; 
		private ChannelOutputInt out2= null; 

		public Phil(int i, ChannelInputInt in,
				ChannelOutputInt out) {
		    this.number = i;
		    this.in1 = in; 
			this.out2= out;

		}

		public void run(){   

		   
			System.out.println (number + "This version uses *symmetric* channels");
			
		      new Parallel (
		    	        new CSProcess[] {
		    	        		new PrefixInt ( number,in1, out2),
		    	        		new Reciv(number+3, in1)
		    	        }
		    	      ).run ();
		      System.out.println (number + "wyslano i odbieram");
		    //  System.out.println (in1.read());
		    //  System.out.println (in2.read());
		} 
	}
	
	
